/*           Copyright(c) 2005-2008 Dave Sexton            *
 *                   HtmlEditor Control                    *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using mshtml;
using System.Windows.Forms;

namespace DaveSexton.Controls
{
	/// <summary>
	/// Provides arguments for <see cref="HtmlEditor" /> events that support cancelation.
	/// </summary>
	public class HtmlEditorCancelEventArgs : HtmlEditorEventArgs
	{
		#region Public Properties
		public virtual bool Cancel
		{
			get
			{
				return cancel;
			}
			set
			{
				cancel = value;
			}
		}
		#endregion

		#region Private / Protected
		private bool cancel;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="HtmlEditorCancelEventArgs" /> class.
		/// </summary>
		public HtmlEditorCancelEventArgs(HtmlEvent @event)
			: base(@event)
		{
		}

		/// <summary>
		/// Constructs a new instance of the <see cref="HtmlEditorCancelEventArgs" /> class.
		/// </summary>
		public HtmlEditorCancelEventArgs(HtmlEvent @event, bool cancel)
			: base(@event)
		{
			this.cancel = cancel;
		}
		#endregion

		#region Methods
		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1061:DoNotHideBaseClassMethods")]
    public new static HtmlEditorCancelEventArgs FromEvent(HtmlDocument document, object htmlEvent)
		{
      return new HtmlEditorCancelEventArgs(new HtmlEvent(document, (IHTMLEventObj) htmlEvent));
		}

    public static HtmlEditorCancelEventArgs FromEvent(HtmlDocument document, object htmlEvent, bool cancel)
		{
      return new HtmlEditorCancelEventArgs(new HtmlEvent(document, (IHTMLEventObj) htmlEvent), cancel);
		}

		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1061:DoNotHideBaseClassMethods")]
    public new static HtmlEditorCancelEventArgs FromEvent(HtmlDocument document, object htmlEvent, HtmlElementEventArgs baseArgs)
		{
      return new HtmlEditorCancelEventArgs(new HtmlEvent(document, (IHTMLEventObj) htmlEvent, baseArgs));
		}

    public static HtmlEditorCancelEventArgs FromEvent(HtmlDocument document, object htmlEvent, HtmlElementEventArgs baseArgs, bool cancel)
		{
      return new HtmlEditorCancelEventArgs(new HtmlEvent(document, (IHTMLEventObj) htmlEvent, baseArgs), cancel);
		}

		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1061:DoNotHideBaseClassMethods")]
    internal new static HtmlEditorCancelEventArgs FromEvent(HtmlDocument document, IHTMLEventObj htmlEvent, HtmlElementEventArgs baseArgs)
		{
      return new HtmlEditorCancelEventArgs(new HtmlEvent(document, htmlEvent, baseArgs));
		}
		#endregion
	}
}
